package com.blog.controller;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.blog.pojo.Tag;
import com.blog.pojo.Type;
import com.blog.service.BlogTypeService;
import com.blog.service.RedisService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * Copyright (C), 2022
 * Author: 苏大大
 * Date: 2022-04-23 16:28
 * FileName: BlogTagController
 * Description: 博客标签控制层
 */
@RestController
@RequestMapping("blog/type")
@Slf4j
@CrossOrigin
public class BlogTypeController {
    @Resource
    private BlogTypeService blogTypeService;


    @GetMapping("/queryAll")
    public String queryAll(){
        JSONObject object=new JSONObject();
        List list=blogTypeService.queryTypeAll();
        object.put("typeList",list);
        return object.toJSONString();
    }
}
